import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'


//引入echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

import axios from "axios"; //导入axios插件



axios.defaults.baseURL="http://localhost:80"
//axios设置它的请求拦截器---->在请求头设置token内容---->
//起个别名  axios挂在到Vue中并在Vue中的名字 $http
Vue.prototype.$http=axios;
Vue.config.productionTip = false
axios.interceptors.request.use(config=>{
  var token=sessionStorage.getItem("token");
  // console.log(token)
  if (token){
    config.headers.token=token;
  }
  return config;
})


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
